<?php
/******************************************************************************
 copy Customization
 created by Sivakumaran
 File Description:
 		To copy customizations and delete existing customizations
	 	
/*****************************************************************************/

include("../../includes/global_files/tables.inc");
include(DOCINCLUDES."global_files/global_locale.inc");
include(DOCINCLUDES."global_files/global_html.inc");
include(DOCINCLUDES."global_files/report_php.inc");
include(DOCINCLUDES."global_files/tables.inc");
include(DOCINCLUDES."global_files/global_session.inc");
include(DOCINCLUDES."global_files/form_php.inc");
include(DOCINCLUDES."global_files/global_pgsql.inc");
include(DOCINCLUDES."global_files/global_validations.inc");
$db=new cDatabase();
$page=new cPage();
$form= new cForm();
$report_id=$_GET["report_id"];
$customization_id=$_GET["customization_id"];
echo "<body bgcolor=\"#d6ebff\"><br>";
echo "<form name=\"custom_selection\" method=\"post\" action=\"available_customization.php\">";

echo "<div align=\"center\" >";
echo "<br>Report Format Name : &nbsp;".$form->generateInputTag("text",array("name"=>"customization_name"));
echo "<br><br>";
echo $form->generateInputTag("button",array("name"=>"create","value"=>"Create","onclick"=>"if(customization_name.value.toLowerCase()=='default'){alert('Default Name not allowed !');customization_name.value='';}else{doSubmit('custom_selection');}"));
echo $form->generateInputTag("hidden",array("name"=>"clone[$customization_id]","value"=>"$customization_id"));
echo $form->generateInputTag("hidden",array("name"=>"report_id","value"=>"$report_id"));
echo "</div></form>";

?>

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">

function doSubmit(target)
	{
	if(document.eval(target).customization_name.value=='')
		{
		alert('Please enter report format name');
		}
	else
		{
		document.custom_selection.submit();
		
		}
	
	}
</script>